package org.demo.service.article.impl;

import java.util.List;

import org.demo.dao.mapper.ArticleMapper;
import org.demo.dao.model.Article;
import org.demo.service.article.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

@Transactional
public class ArticleServiceImpl implements ArticleService{

	@Autowired
	private ArticleMapper mapper;
	
	public int save(Article record) {
		return mapper.insertSelective(record);
	}

	public int remove(Integer id) {
		return mapper.deleteByPrimaryKey(id);
	}

	public int update(Article record) {
		return mapper.updateByPrimaryKeySelective(record);
	}

	public Article selectById(Integer id) {
		return mapper.selectByPrimaryKey(id);
	}

	public List<Article> selectAll() {
		return mapper.selectAll();
	}

}
